<template>
    <div class="ml-16px mr-16px content-container">
        <div class="flex items-center pt-26px pl-26px pr-26px">
            <Remind v-if="isShowRemind" @update:data="isShowRemind = !isShowRemind">
                <template #title>
                    短视频发布注意事项 <el-link href="https://www.baidu.com/" type="primary" underline="always">（查看视频）</el-link>
                </template>
                <template #content>
                    请务必发布原创视频，且确保视频为首次发布（未在任何视频平台发布过），不可重复发布，避免审核无法通过。<br>
                    视频清晰，不可展示商家地址、商家联系方式、二维码等，不可展示价格、打折等，不可进行好物安利并引导站外购买等, <el-link href="https://www.baidu.com/"
                        type="danger">会导致帐号异常甚至封号</el-link> 。<br>
                    不可发布裸露、招商加盟、药品、医疗、金融、交友、灰色行业和国家和平台禁止行业视频相关内容, <el-link href="https://www.baidu.com/"
                        type="danger">会导致封号并可能承担法律责任</el-link> 。<br>
                    请用户严格遵守法律法规，不得发布任何违法、违规、低俗、过激、虚假及违反社会公序良俗等信息！<br>
                    请仔细阅读并遵守：<el-link href="https://www.baidu.com/" type="primary"
                        underline="always">信息安全规范承诺函、禁用语及敏感词规则。</el-link><br>
                    开始使用本产品/服务即代表用户（购买或使用方）完全知情并同意遵守信息安全规范承诺及相应的规则规章，如有违反所造成的的一切后果及责任由用户完全承担。
                </template>
            </Remind>
        </div>
        <div class="flex flex-center pt-30px pb-15px">
            <div class="flex steps">
                <div class="item" :class="{ 'step': state.step === index }" v-for="(item, index) in state.steps"
                    :key="index">
                    <p v-html="item.title"></p>
                    <span>{{ item.txt }}</span>
                </div>
            </div>
        </div>
        <div class="px-26px">
            <el-divider />
        </div>
        <template v-if="state.step === 0">
            <div class="text-12px lh-18px px-26px text-#999">
                1、请选择视频文件夹。<br>
                2、为了更好的观看体验，推荐上传16:9，分辨率为720p（1280x720）及以上的竖版视频。<br>
                3、支持常用视频格式，推荐使用mp4 、webm格式。<br>
                4、视频文件大小不超过500M，抖音要求时长在15分钟以内。<br>
                5、带品牌logo或品牌水印的视频，会命中平台的审核逻辑，有比较大的概率导致分享视频推荐降权处理/分享视频下架处理/分享账号被封禁处理。强烈建议客户自行处理好分享内容中的不合规水印。
            </div>
            <div class="px-26px pt-20px pb-26px">
                <el-form ref="ruleFormRef" :model="ruleForm" :rules="rules" label-width="auto">
                    <el-form-item label="任务名称" prop="name">
                        <el-input v-model="ruleForm.name" placeholder="请输入任务名称" class="w-300px" />
                    </el-form-item>
                    <el-form-item label="选择视频" prop="video">
                        <div class="flex items-center">
                            <div class="w-300px">
                                <el-select v-model="ruleForm.video" placeholder="请选择视频文件夹">
                                    <el-option label="实时" value="1" />
                                </el-select>
                            </div>
                            <div class="text-14px text-#999 ml-12px">
                                还没视频文件夹？ <el-link type="primary">去创建</el-link>
                            </div>
                        </div>
                    </el-form-item>
                    <el-form-item label="选择封面" prop="cover">
                        <div class="flex items-center">
                            <div class="w-300px">
                                <el-select v-model="ruleForm.cover" placeholder="请选择视频封面">
                                    <el-option label="实时" value="1" />
                                </el-select>
                            </div>
                            <div class="text-14px text-#999 ml-12px">
                                还没封面？ <el-link type="primary">去创建</el-link>
                            </div>
                        </div>
                    </el-form-item>
                    <el-form-item>
                        <div class="pl-77px pt-20px">
                            <el-button type="primary" @click="handleNext">下一步</el-button>
                        </div>
                    </el-form-item>

                </el-form>
            </div>
        </template>
        <template v-if="state.step === 1">
            <div class="pl-36px pt-26px pr-26px text-14px font-bold level-2-title">
                抖音发布设置
            </div>
            <div class="px-26px pt-20px">
                <el-form ref="ruleFormRef" :model="ruleForm" :rules="rules" label-width="auto">
                    <el-form-item label="账号" prop="account">
                        <div class="w-350px">
                            <el-select v-model="ruleForm.account" placeholder="请选择账号">
                                <el-option label="实时" value="1" />
                            </el-select>
                        </div>
                    </el-form-item>
                    <el-form-item label="发布时间" prop="publishDate">
                        <div class="w-300px">
                            <el-date-picker v-model="ruleForm.publishDate" type="daterange" range-separator="至"
                                value-format="yyyy-MM-dd" start-placeholder="开始日期"
                                end-placeholder="结束日期"></el-date-picker>
                        </div>
                    </el-form-item>
                    <el-form-item label="每天发布计划" prop="dayTime">
                        <div class="flex">
                            <div class="w-169px mr-12px">
                                <el-time-select placeholder="起始时间" v-model="ruleForm.startTime"
                                    :picker-options="{ start: '00:00', step: '1:00', end: '24:00' }"></el-time-select>
                            </div>
                            <div class="w-169px mr-20px">
                                <el-time-select placeholder="结束时间" v-model="ruleForm.endTime"
                                    :picker-options="{ start: '00:00', step: '1:00', end: '24:00', minTime: ruleForm.startTime }"></el-time-select>
                            </div>
                            <span>每个账号发布</span>
                            <el-input-number v-model="ruleForm.num" :min="1" :max="9999999" size="small"
                                class="ml-10px mr-10px"></el-input-number>
                            <span>条　</span>
                            <el-button :icon="Plus" type="primary" plain circle
                                @click="addPublishDayTime()"></el-button>
                        </div>
                    </el-form-item>
                    <el-form-item label="地点/商圈" prop="area">
                        <div>
                            <div class="flex">
                                <el-input placeholder="请输入地点/商圈名称" class="w-200px mr-12px"></el-input>
                                <el-input placeholder="请输入城市" class="w-200px mr-12px"></el-input>
                                <el-button type="primary" :icon="Search"
                                    v-debounce="{ callback: handleSearch, delay: 300 }">搜索</el-button>
                            </div>
                            <div class="flex pt-15px w-961px">
                                <el-table class="w-full table-border">
                                    <el-table-column prop="name" label="名称" width="200" />
                                    <el-table-column prop="address" label="地址" />
                                    <el-table-column prop="city" label="城市" width="120" />
                                    <el-table-column label="" width="100">
                                        <template #default="scope">
                                            <el-button type="primary" size="small">选择</el-button>
                                        </template>
                                    </el-table-column>
                                </el-table>
                            </div>
                        </div>
                    </el-form-item>
                </el-form>
            </div>
            <div class="pl-36px pt-26px pr-26px text-14px font-bold level-2-title">
                快手发布设置
            </div>
            <div class="px-26px pt-20px">
                <el-form ref="ruleFormRef" :model="ruleForm" :rules="rules" label-width="auto">
                    <el-form-item label="账号" prop="account">
                        <div class="w-350px">
                            <el-select v-model="ruleForm.account" placeholder="请选择账号">
                                <el-option label="实时" value="1" />
                            </el-select>
                        </div>
                    </el-form-item>
                    <el-form-item label="发布时间" prop="publishDate">
                        <div class="w-300px">
                            <el-date-picker v-model="ruleForm.publishDate" type="daterange" range-separator="至"
                                value-format="yyyy-MM-dd" start-placeholder="开始日期"
                                end-placeholder="结束日期"></el-date-picker>
                        </div>
                    </el-form-item>
                    <el-form-item label="每天发布计划" prop="dayTime">
                        <div class="flex">
                            <div class="w-169px mr-12px">
                                <el-time-select placeholder="起始时间" v-model="ruleForm.startTime"
                                    :picker-options="{ start: '00:00', step: '1:00', end: '24:00' }"></el-time-select>
                            </div>
                            <div class="w-169px mr-20px">
                                <el-time-select placeholder="结束时间" v-model="ruleForm.endTime"
                                    :picker-options="{ start: '00:00', step: '1:00', end: '24:00', minTime: ruleForm.startTime }"></el-time-select>
                            </div>
                            <span>每个账号发布</span>
                            <el-input-number v-model="ruleForm.num" :min="1" :max="9999999" size="small"
                                class="ml-10px mr-10px"></el-input-number>
                            <span>条　</span>
                            <el-button :icon="Plus" type="primary" plain circle
                                @click="addPublishDayTime()"></el-button>
                        </div>
                    </el-form-item>
                </el-form>
            </div>
            <div class="pl-36px pt-26px pr-26px text-14px font-bold level-2-title">
                BiliBili发布设置
            </div>
            <div class="px-26px pt-20px pb-26px">
                <el-form ref="ruleFormRef" :model="ruleForm" :rules="rules" label-width="auto">
                    <el-form-item label="账号" prop="account">
                        <div class="w-350px">
                            <el-select v-model="ruleForm.account" placeholder="请选择账号">
                                <el-option label="实时" value="1" />
                            </el-select>
                        </div>
                    </el-form-item>
                    <el-form-item label="发布时间" prop="publishDate">
                        <div class="w-300px">
                            <el-date-picker v-model="ruleForm.publishDate" type="daterange" range-separator="至"
                                value-format="yyyy-MM-dd" start-placeholder="开始日期"
                                end-placeholder="结束日期"></el-date-picker>
                        </div>
                    </el-form-item>
                    <el-form-item label="每天发布计划" prop="dayTime">
                        <div class="flex">
                            <div class="w-169px mr-12px">
                                <el-time-select placeholder="起始时间" v-model="ruleForm.startTime"
                                    :picker-options="{ start: '00:00', step: '1:00', end: '24:00' }"></el-time-select>
                            </div>
                            <div class="w-169px mr-20px">
                                <el-time-select placeholder="结束时间" v-model="ruleForm.endTime"
                                    :picker-options="{ start: '00:00', step: '1:00', end: '24:00', minTime: ruleForm.startTime }"></el-time-select>
                            </div>
                            <span>每个账号发布</span>
                            <el-input-number v-model="ruleForm.num" :min="1" :max="9999999" size="small"
                                class="ml-10px mr-10px"></el-input-number>
                            <span>条　</span>
                            <el-button :icon="Plus" type="primary" plain circle
                                @click="addPublishDayTime()"></el-button>
                        </div>
                    </el-form-item>
                    <el-form-item>
                        <div class="pl-96px pt-20px">
                            <el-button type="info" @click="handlePure">上一步</el-button>
                            <el-button type="primary" @click="handleNext">下一步</el-button>
                        </div>
                    </el-form-item>
                </el-form>
            </div>
        </template>
        <template v-if="state.step === 2">
            <div class="pt-26px pl-26px pr-26px words-container">
                <el-row :gutter="26">
                    <el-col :span="8">
                        <div class="words-item">
                            <div class="flex items-center justify-between words-item__title font-bold text-14px">
                                <div>
                                    前缀/地区词（6个）
                                </div>
                                <div>
                                    <el-button size="small">
                                        清空
                                    </el-button>
                                </div>
                            </div>
                            <div class="words-item__list">
                                <el-scrollbar>


                                </el-scrollbar>
                            </div>
                        </div>
                    </el-col>
                    <el-col :span="8">
                        <div class="words-item">
                            <div class="flex items-center justify-between words-item__title font-bold text-14px">
                                <div>
                                    主词（5个）
                                </div>
                                <div>
                                    <el-button size="small">
                                        清空
                                    </el-button>
                                </div>
                            </div>
                            <div class="words-item__list">
                                <el-scrollbar>

                                </el-scrollbar>
                            </div>
                        </div>
                    </el-col>
                    <el-col :span="8">
                        <div class="words-item">
                            <div class="flex items-center justify-between words-item__title font-bold text-14px">
                                <div>
                                    后缀词（5个）
                                </div>
                                <div>
                                    <el-button type="primary" size="small">
                                        选择后缀
                                    </el-button>
                                    <el-button size="small">
                                        清空
                                    </el-button>
                                </div>
                            </div>
                            <div class="words-item__list">
                                <el-scrollbar>

                                    <div class="words-item__form">

                                    </div>
                                </el-scrollbar>
                            </div>
                        </div>
                    </el-col>
                </el-row>
            </div>
            <div class="pt-26px pl-26px pr-26px words-container">
                <el-row :gutter="26">
                    <el-col :span="8">
                        <div class="words-item">
                            <div class="flex items-center justify-between words-item__title font-bold text-14px">
                                <div class="flex items-center">
                                    引导语（4个）
                                    <el-link type="warning" class=ml-10px><svg-icon size="16px"
                                            icon-class="information-2-fill" class="mr-4px"></svg-icon>案例介绍</el-link>
                                </div>
                                <div>
                                    <el-button type="primary" size="small">
                                        AI生成
                                    </el-button>
                                    <el-button size="small">
                                        清空
                                    </el-button>
                                </div>
                            </div>
                            <div class="words-item__list">
                                <el-scrollbar>


                                </el-scrollbar>
                            </div>
                        </div>
                    </el-col>
                    <el-col :span="8">
                        <div class="words-item">
                            <div class="flex items-center justify-between words-item__title font-bold text-14px">
                                <div class="flex items-center">
                                    产品优势（5个）
                                    <el-link type="warning" class=ml-10px><svg-icon size="16px"
                                            icon-class="information-2-fill" class="mr-4px"></svg-icon>案例介绍</el-link>
                                </div>
                                <div>
                                    <el-button type="primary" size="small">
                                        AI生成
                                    </el-button>
                                    <el-button size="small">
                                        清空
                                    </el-button>
                                </div>
                            </div>
                            <div class="words-item__list">
                                <el-scrollbar>

                                </el-scrollbar>
                            </div>
                        </div>
                    </el-col>
                    <el-col :span="8">
                        <div class="words-item">
                            <div class="flex items-center justify-between words-item__title font-bold text-14px">
                                <div class="flex items-center">
                                    互动语（4个）
                                    <el-link type="warning" class=ml-10px><svg-icon size="16px"
                                            icon-class="information-2-fill" class="mr-4px"></svg-icon>案例介绍</el-link>
                                </div>
                                <div>
                                    <el-button type="primary" size="small">
                                        AI生成
                                    </el-button>
                                    <el-button size="small">
                                        清空
                                    </el-button>
                                </div>
                            </div>
                            <div class="words-item__list">
                                <el-scrollbar>

                                    <div class="words-item__form">

                                    </div>
                                </el-scrollbar>
                            </div>
                        </div>
                    </el-col>
                </el-row>
            </div>
            <div class="px-26px pt-20px pb-26px">
                <el-form ref="ruleFormRef" :model="ruleForm" :rules="rules" label-width="auto">
                    <el-form-item label="视频话题" prop="account">
                        <div>
                            <div class="flex items-center">
                                <div class="w-250px mr-12px">
                                    <el-select v-model="ruleForm.account" placeholder="请选择话题数量">
                                        <el-option label="实时" value="1" />
                                    </el-select>
                                </div>
                                <div class="flex">
                                    <el-button type="primary" plain>随机生成</el-button>
                                    <el-button type="primary" plain>主词生成</el-button>
                                    <el-button type="primary" plain>前缀+主词生成</el-button>
                                    <el-button type="primary" plain>主词+后缀生成</el-button>
                                    <el-button type="primary" plain>前缀+主词+后缀生成</el-button>
                                </div>
                            </div>
                            <div class="mt-12px w-896px">
                                <el-input v-model="ruleForm.topic" :rows="5" maxlength="300" type="textarea" placeholder="请输入或生成话题" show-word-limit />
                            </div>
                        </div>
                    </el-form-item>
                    <el-form-item label="视频标题" prop="account">
                        <div>
                            <div class="flex items-center">
                                <div class="flex">
                                    <el-button type="primary" plain>组合标题</el-button>
                                </div>
                            </div>
                            <div class="mt-12px w-896px">
                                <el-input v-model="ruleForm.topic" :rows="5" maxlength="300" type="textarea" placeholder="请输入或生成话题" show-word-limit />
                            </div>
                        </div>
                    </el-form-item>
                    <el-form-item>
                        <div class="pl-77px pt-20px">
                            <el-button type="info" @click="handlePure">上一步</el-button>
                            <el-button type="primary" @click="handleSubmit">提交</el-button>
                        </div>
                    </el-form-item>
                </el-form>
            </div>
        </template>
    </div>
</template>

<script setup lang="ts">
import { Plus, Search } from '@element-plus/icons-vue'
import type { FormInstance, FormRules } from 'element-plus'

const isShowRemind = ref(true)

const state = reactive({
    step: 2,
    steps: [
        {
            title: '第<b>1</b>步',
            txt: '基础配置'
        },
        {
            title: '第<b>2</b>步',
            txt: '视频配置'
        },
        {
            title: '第<b>3</b>步',
            txt: '话题与标题配置'
        }
    ]
})

const ruleFormRef = ref()

const ruleForm = reactive({
    name: '',
    video: '',
    cover: '',
    account: '',
    publishDate: '',
    dayTime: '',
    startTime: '',
    endTime: '',
    num: 0,
    area: '',
    topic:''
})

const rules = reactive({
    name: [
        { required: true, message: '请输入任务名称', trigger: 'blur' }
    ],
    video: [
        { required: true, message: '请选择视频文件夹' }
    ],
    account: [
        { required: true, message: '请选择账号' }
    ],
    publishDate: [
        { required: true, message: '请选择发布时间' }
    ],
})

function handleNext() {
    state.step++
}

function handlePure() {
    state.step--
}

function handleSubmit(){
    
}

function addPublishDayTime() {

}

function handleSearch() {
    console.log('search')
}
</script>

<style lang="scss">



</style>